Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

238
Views
what is "is" keyword used for in JavaScript?

so i dont understand the logic behind "is" keyword (here "isSleeping") i see lots of time studying javascript.

does it mean something results boolean?

let animal = {
  walk() {
    if (!this.isSleeping) {
      alert(`I walk`);
    }
  },
  sleep() {
    this.isSleeping = true;
  }
};

let rabbit = {
  name: "White Rabbit",
  __proto__: animal
};

// modifies rabbit.isSleeping
rabbit.sleep();

alert(rabbit.isSleeping); 
alert(animal.isSleeping); 

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

"is" is not a keyword it's a way of naming your boolean variables AKA naming convention, so when other people see a variable with "is" in front they know that variable is a boolean.

By @ironmouse The same goes with "has": For example there could be functions like "hasSiblings" or "isMarried" that return a boolean type. However the return type is not set in stone but it is a good convention for developers.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!